<?php
$mem = new Memcache();
$mem->connect('localhost', '11211'); //连接memached服务器




$conn = mysql_connect("localhost", "root", "root");

mysql_select_db("memteset");
mysql_query("set names 'utf8'");
$query = "select * from goods";


//
$result = mysql_query($query);

while ($row = mysql_fetch_assoc($result)) {
	print_r($row);
	echo '</br>';
	print_r($row['g_name']);
	$mem->set('goods_' . $row['id'], $row, 0, 0);
}
$array = array(
'1'=>2,
'2'=>3
);
print_r($array);







//$mem->set('goods_1', array('name'=>'运动鞋', 'price'=>'100'), 0, 0);
//$mem->set('goods_2', array('name'=>'运动衫', 'price'=>'200'), 0, 0);
//
//$mem->set('goods_3', array('name'=>'阿迪达斯', 'price'=>'1100'), 0, 0);
//
//$mem->set('goods_4', array('name'=>'耐克', 'price'=>'890'), 0, 0);
//
//$mem->set('goods_5', array('name'=>'足球鞋', 'price'=>'1020'), 0, 0);
